<table width="200" height="5" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>

<table width="1000" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="ffeac7">
  <tr>
    <td height="91" valign="top" bgcolor="fffbed">&nbsp;&nbsp;<span class="tit">今日十大名菜</span><br>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <?php 
          foreach ($recommFood as $v):
          	$foodInfo = FoodPeer::retrieveByPK($v->getObjectId());
          	if($foodInfo):
          	$imgStr = $foodInfo->getImg();
          	$imgsArr= explode('|',$imgStr); 
          ?>
          <td align="center">
          	<a href="/food/intro?id=<?php echo $foodInfo->getId()?>">
          		<img src="<?php echo SITE_URL.'uploads/'.$imgsArr['0']?>" width="80" height="80" border="0" class="img" />
          	</a><br>
          	</td>
          	<?php endif;?>
          <?php endforeach; ?>
        </tr>
        <tr>
         <?php 
          foreach ($recommFood as $v):
          	$foodInfo = FoodPeer::retrieveByPK($v->getObjectId());
          	if($foodInfo):
          ?>
          <td align="center" height="35">
          	<a href="/food/intro?id=<?php echo $foodInfo->getId()?>" class="imgword"><?php echo $foodInfo->getName()?></a><br />
          </td>
         	<?php endif;?>
          <?php endforeach; ?>
        </tr>
    </table></td>
  </tr>
</table>
<table width="200" height="5" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="2%" background="<?php echo SITE_URL?>img/made/made_r5_c3.jpg"><img src="<?php echo SITE_URL?>img/made/made_r5_c2.jpg" width="6" height="33" /></td>
    <td width="34%" background="<?php echo SITE_URL?>img/made/made_r5_c3.jpg" class="weizhi">您当前所在的位置：
    <a href="<?php echo SITE_URL?>" class="weizhi">首页</a> &gt;&gt;
    <a href="/food/intro?id=<?php echo $food->getId();?>" class="weizhi"> <?php echo $food->getName()?> </a>&gt;&gt;
    做法分享 </td>
    <td width="44%" background="<?php echo SITE_URL?>img/made/made_r5_c3.jpg">&nbsp;</td>
    <td width="19%" background="<?php echo SITE_URL?>img/made/made_r5_c3.jpg">
    <a href="/food/method?id=<?php echo $food->getId()?>" class="login">做法</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="/food/img?id=<?php echo $food->getId()?>" class="login">相册</a></td>
    <td width="1%" align="right" background="<?php echo SITE_URL?>img/made/made_r5_c3.jpg"><img src="<?php echo SITE_URL?>img/made/made_r5_c23.jpg" width="9" height="33" /></td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="24%" height="553" align="right" valign="top"><table width="231" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="<?php echo SITE_URL?>img/dp/dianp_r2_c2.jpg" width="230" height="8" /></td>
      </tr>
    </table>
      <table width="230" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="23" align="left" valign="top" background="<?php echo SITE_URL?>img/dp/dianp_r5_c2.jpg" class="tit">
          &nbsp;&nbsp;* 发布新做法的好吃嘴
          </td>
        </tr>
        <tr>
          <td height="34" valign="top" background="<?php echo SITE_URL?>img/dp/dianp_r5_c2.jpg"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
            <?php
            $user1 = array_slice($users,0,4);
            $user2 = array_slice($users,4,4);
            ?>
            <?php foreach ($user1 as $v):?>
              <td align="center">
              	<img src="<?php echo SITE_URL."ucenter/avatar.php?uid=".$v->getUserId()."&size=small"?>" width="38" height="38" class="headimg" /><br />
              </td>
              <?php endforeach;?>
            </tr>
            <tr>
              <?php 
              foreach ($user1 as $v):
              $info = getUserById($v->getUserId());
              ?>
              <td align="center" height="25">
              	<a href="<?php echo SNS_URL.'/../space.php?uid='.$v->getUserId()?>" class="imgword"><?php echo $info['username']?></a>
              </td>
              <?php endforeach;?>
            </tr>
          </table>
            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
               <?php foreach ($user2 as $v):?>
                <td align="center">
                <img src="<?php echo SITE_URL."ucenter/avatar.php?uid=".$v->getUserId()."&size=small"?>" width="38" height="38" class="headimg" /><br />
                </td>
                <?php endforeach;?>
              </tr>
              <tr>
                <?php 
                foreach ($user2 as $v):
                $info = getUserById($v->getUserId());
                ?>
                <td align="center" height="25">
                	<a href="<?php echo SNS_URL.'/../space.php?uid='.$v->getUserId()?>" class="imgword"><?php echo $info['username']?></a>
                </td>
                <?php endforeach;?>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="230" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="<?php echo SITE_URL?>img/dp/dianp_r14_c2.jpg" width="230" height="10" /></td>
        </tr>
      </table>
      <table width="231" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>     
	   <table width="231" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>
      <table width="231" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="<?php echo SITE_URL?>img/made/made_r16_c1.jpg" width="231" height="7" /></td>
        </tr>
      </table>
      <table width="231" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="left" background="<?php echo SITE_URL?>img/made/made_r18_c1.jpg"><table width="95%" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td class="tit">&nbsp;&nbsp;* 最新评论</td>
              <td class="tit">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td background="<?php echo SITE_URL?>img/made/made_r18_c1.jpg" height="5"></td>
        </tr>
        <tr>
          <td background="<?php echo SITE_URL?>img/made/made_r18_c1.jpg"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <?php foreach ($comments as $v):?>
            <tr>
              <td width="61%" height="25" align="left" class="word"><?php echo $v->getContent();?></td>
              <td width="39%" align="left"><span class="yh">
              <?php
              $userInfo = getUserById($v->getUserId());
              echo $userInfo['username'];
              ?>
              </span><span class="word">的做法</span></td>
            </tr>
            <?php endforeach;?>
          </table></td>
        </tr>
      </table>
      <table width="231" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="<?php echo SITE_URL?>img/made/made_r22_c1.jpg" width="231" height="7" /></td>
        </tr>
      </table>
      <table width="231" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>
    </td>
    <td width="76%" align="center" valign="top"><table width="746" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="<?php echo SITE_URL?>img/made/made_r7_c10.jpg" width="746" height="7" /></td>
      </tr>
    </table>
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="80" valign="top" background="<?php echo SITE_URL?>img/made/made_r9_c10.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="15"></td>
            </tr>
          </table>
          <?php foreach ($methods->getResults() as $v):?>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="13%" rowspan="4" align="center" valign="top">
              <img src="<?php echo SITE_URL."ucenter/avatar.php?uid=".$v->getUserId()."&size=small"?>" width="72" height="73" class="headimg" /><br><br>
              <span class="yhbig">
              <?php
              $userInfo = getUserById($v->getUserId());
              echo $userInfo['username'];
              ?>
              </span></td>
              <td align="left" class="tit" height="30">标准做法：</td>
            </tr>
            <tr>
              <td height="64" valign="top" class="word"><?php echo $v->getDes();?></td>
            </tr>
            <tr>
              <td>
              	<?php
              	$imgStr = $v->getImg();
              	$imgsArr= explode("|",$imgStr); 
              	?>
              	<?php if($imgsArr['0']):?>
              	<img src="<?php echo SITE_URL.'uploads/'.$imgsArr['0']?>" width="80" height="50" class="img" />&nbsp;&nbsp;
              	<?php endif;?>
              	<?php if($imgsArr['1']):?>
              	<img src="<?php echo SITE_URL.'uploads/'.$imgsArr['1']?>" width="80" height="50" class="img" />&nbsp;&nbsp;
              	<?php endif;?>
              	<?php if($imgsArr['2']):?>
              	<img src="<?php echo SITE_URL.'uploads/'.$imgsArr['2']?>" width="80" height="50" class="img" />
              	<?php endif;?>
              	</td>
              </tr>
            <tr>
              <td align="center" class="word" height="30">
              评论（3条）<a href="#">点击查看</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">我也评评</a></td>
            </tr>
          </table>
            <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#CCCCCC" height="2"></td>
              </tr>
            </table>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table>
            <?php endforeach;?>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td align="right">
                <span class="word">当前30条做法中的1-10条，</span>
                <span class="yh">上一页</span> 
                <span class="yh">1</span> | 
                <span class="yh">2</span> 
                <span class="yh">下一页</span></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="<?php echo SITE_URL?>img/made/made_r28_c10.jpg" width="746" height="7" /></td>
        </tr>
      </table>
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="<?php echo SITE_URL?>img/made/made_r30_c10.jpg" width="746" height="11" /></td>
        </tr>
      </table>
      <form method="POST" name="method" action="/method/update?food_id=<?php echo $food->getId()?>" enctype="multipart/form-data">
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="25" colspan="2" background="<?php echo SITE_URL?>img/made/made_r32_c10.jpg" class="titsmall">
          &nbsp;&nbsp;我有不同做法 
          </td>
        </tr>
        <tr>
          <td colspan="2" align="center" background="<?php echo SITE_URL?>img/made/made_r32_c10.jpg">
          	<textarea name="des" cols="90" rows="5" class="textinfo"></textarea>
          </td>
        </tr>
        <tr>
          <td width="362" height="40" background="<?php echo SITE_URL?>img/made/made_r32_c10.jpg" class="titsmall">
          &nbsp;&nbsp;&nbsp;SHOW下我的成果
          	<div id="foodimg" style="margin-left:10px;">
				<div id="1">
					<input name="img[]" type="file" onchange="addimg(1)" />
				</div>
			</div>
           </td>
          <td width="384" background="<?php echo SITE_URL?>img/made/made_r32_c10.jpg" class="tit"><table width="115" height="28" border="0" cellpadding="0" cellspacing="0">
            <!-- <tr>
              <td align="center" background="<?php echo SITE_URL?>img/anniu/an_r5_c7.gif"><span class="titsmall">浏览</span></td>
              <td width="7"></td>
              <td align="center" background="<?php echo SITE_URL?>img/anniu/an_r5_c7.gif"><span class="titsmall">上传</span></td>
            </tr> -->
          </table></td>
        </tr>
        <!-- <tr>
          <td height="70" colspan="2" align="center" background="<?php echo SITE_URL?>img/made/made_r32_c10.jpg">
          <table width="43%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><img src="<?php echo SITE_URL?>img/made/ceshi.jpg" width="80" height="50" class="img" /><br>
                <span class="word">删除</span></td>
              <td><img src="<?php echo SITE_URL?>img/made/ceshi.jpg" width="80" height="50" class="img" /><br>
                <span class="word">删除</span></td>
              <td><img src="<?php echo SITE_URL?>img/made/ceshi.jpg" width="80" height="50" class="img" /><br>
                <span class="word">删除</span></td>
            </tr>
          </table>          </td>
        </tr> -->
        <tr>
          <td height="6" colspan="2" align="center" background="<?php echo SITE_URL?>img/made/made_r32_c10.jpg" class="tit"><img src="<?php echo SITE_URL?>img/made/made_r45_c13.jpg" width="47" height="31" onclick="$('form')[0].submit()"/></td>
        </tr>
        </form>
      </table>
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="<?php echo SITE_URL?>img/made/made_r39_c10.jpg" width="746" height="9" /></td>
        </tr>
      </table>
      <table width="746" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<script>
function addimg(id){
	if($('div').length > 3){
		alert("只能上传3张图片!");
		var delStr = "&nbsp;<a href='javascript:delimg("+id+")'>删除</a>";
		$('#'+id).append(delStr);
		return false;
	}
	var newId = id+1;
	var delStr = "&nbsp;<a href='javascript:delimg("+id+")'>删除</a>";
	var addStr = "<div id='"+newId+"'><input type='file' name='img[]' onchange='addimg("+newId+")'></div>";
	$('#'+id).append(delStr);
	$('#foodimg').append(addStr);
}
function delimg(id){
	$('#'+id).remove();
}
</script>

